package com.mtoolkit.socket.transocder;

import java.io.IOException;

import com.mtoolkit.socket.SocketResponse;


public class DefaultSocketResponseTranscoder implements SocketResponseTranscoder {

    @Override
    public byte[] sealResponse(SocketResponse response) throws IOException {
        byte[] result = TranscoderUtil.object2Bytes(response);
        return result;
    }

    @Override
    public SocketResponse unsealResponse(byte[] bytes) throws ClassNotFoundException, IOException {
        return TranscoderUtil.bytes2Object(bytes);
    }

}
